home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr11 / pdox693.zip / TI1147.ASC < prev    next >
Text File  |  1992-10-13  |  3KB  |  133 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  Paradox                               NUMBER  :  1147
  9.   VERSION  :  4.0
  10.        OS  :  DOS
  11.      DATE  :  October 13, 1992                         PAGE  :  1/2
  12.  
  13.     TITLE  :  Adding Alphanumeric Fields to Form One Memo Field
  14.  
  15.  
  16.  
  17.  
  18.   This Technical Information sheet illustrates how you can use PAL
  19.   to add alphanumeric fields together to form one Memo Field.
  20.  
  21.   Normally, if you wanted to add two fields together to create a
  22.   third field, you would use example elements in a query.  Paradox
  23.   4.0 memo fields do not allow the use of example elements.
  24.   Instead, you must write a script to accomplish this task.  In our
  25.   example, we have a table with three "A255" fields which we want
  26.   to add together to form one Memo field.  First, you have to do a
  27.   Modify | Restructure and add a Memo field to your table.  Then
  28.   play a script which will concatenate the three fields together
  29.   (separating the contents of each field by a space) and place the
  30.   result in a Memo field.
  31.  
  32.   Note: Before making any global changes to a table, it is a good
  33.   idea to first make a backup copy of the table.
  34.  
  35.   To create the script:
  36.  
  37.      1.  From the Paradox Menu, select Scripts | Editor | New
  38.  
  39.      2.  At the prompt, type in the name of your script (i.e.
  40.          FLDADD)
  41.  
  42.      3.  You are now in the Script Editor, type in the PAL code on
  43.          the following page.
  44.  
  45.      4.  When you are finished typing in the PAL code, press <F2>
  46.          to save the script.
  47.  
  48.   Note:  The script on the following page is an model for
  49.   concatenating text fields together and placing the result into a
  50.   Memo field.  In this particular example, three text fields are
  51.   concatenated together; you can to modify your script to
  52.   concatenate any number of text fields.
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  Paradox                               NUMBER  :  1147
  75.   VERSION  :  4.0
  76.        OS  :  DOS
  77.      DATE  :  October 13, 1992                         PAGE  :  2/2
  78.  
  79.     TITLE  :  Adding Alphanumeric Fields to Form One Memo Field
  80.  
  81.  
  82.  
  83.  
  84.   ;The script begins here.
  85.  
  86.   Edit "Tablename"                  ; Place table in edit mode.
  87.   Scan                              ; Scan each record in table.
  88.  
  89.     [MemoField] = [Field1] + " " +  ; Can be used to concatenate
  90.                   [Field2] + " " +  ; any number of text fields.
  91.                   [Field3]          ; The " " separates each field
  92.                                     ; with a space.
  93.   EndScan
  94.  
  95.  
  96.   Any characters after the ";", including the ";" need not be
  97.   entered.  They are only comments.  After playing this script, you
  98.   can do a Modify | Restructure and delete the three "A255" fields.
  99.  
  100.   To play the script:
  101.  
  102.      1.  From the Paradox Menu, select Scripts | Play
  103.  
  104.      2.  At the prompt, type in the name of the script, then press
  105.          <ENTER>.
  106.  
  107.  
  108.   For additional information about PAL, refer to the PAL Reference
  109.   Guide and the PAL Programmer's Guide.  For additional information
  110.   about Memo fields, refer to the Paradox User's Guide.
  111.  
  112.   DISCLAIMER: You have the right to use this technical information
  113.   subject to the terms of the No-Nonsense License Statement that
  114.   you received with the Borland product to which this information
  115.   pertains.
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.